package com.question.java.refect;

import java.lang.reflect.Type;
import java.math.BigDecimal;

/**
 * @Description:
 * @Author: Jun Yang
 * @Time: 2019/1/17 上午11:00
 * @Version: 1.0
 */
public class RefectDemo {
    public static void main(String[] args) throws NoSuchFieldException {

        Class clazz = User.class;
        String typeName = clazz.getDeclaredField("blance").getType().getSimpleName();
        System.out.println("BigDecimal".equals(typeName));

        String birthName = clazz.getDeclaredField("birth").getType().getSimpleName();
        System.out.println("Date".equals(birthName));

        String ageName = clazz.getDeclaredField("age").getType().getSimpleName();
        System.out.println("Integer".equals(ageName));
    }
}
